﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

using XianShang.Data;
using XianShang.Common;
using XianShang.Entity;
using XianShang.Data.DataProvider;

namespace XianShang.Data.DataProvider
{
    public class MoveAccount
    {
        /// <summary>
        /// 在換卡主表中插入一條新數據并返回自增ID值
        /// </summary>
        /// <param name="maInfo"></param>
        /// <returns></returns>
        public static int AddNewMoveAccount(MoveAccountInfo maInfo)
        {
            return DatabaseProvider.GetInstance().AddNewMoveAccount(maInfo);
        }
        /// <summary>
        /// 根據指定值查找轉移帳戶信息
        /// </summary>
        /// <param name="name"></param>
        /// <param name="tel"></param>
        /// <param name="oldAccount"></param>
        /// <param name="newAccount"></param>
        /// <returns></returns>
        public static DataSet GetMoveAccount(string name, string tel, string oldAccount, string newAccount)
        {
            return DatabaseProvider.GetInstance().GetMoveAccount(name,tel,oldAccount,newAccount);
        }

        /// <summary>
        /// 根據實體參數進行查詢
        /// </summary>
        /// <param name="fr"></param>
        /// <param name="SearchType"></param>
        /// <returns></returns>
        public static DataTable GetMoveAccountInfo(MoveAccountInfo ma, int SearchType)
        {
            return Utils.DrToDt(DatabaseProvider.GetInstance().GetMoveAccountInfo(ma, SearchType));
        }

        /// <summary>
        /// 根據 name,tel,bbsaccount,status,newaccount,oldaccount,time取得信息
        /// </summary>
        /// <param name="ma"></param>
        /// <param name="SearchType">查找方式（1精確0模糊）</param>
        /// <param name="pageSize">分頁大小</param>
        /// <param name="pageIndex">當前頁</param>
        /// <returns></returns>
        public static DataTable GetMoveAccountInfo(MoveAccountInfo ma, int SearchType, int pageSize, int pageIndex)
        {
            return Utils.LoadDataRows(DatabaseProvider.GetInstance().GetMoveAccountInfo(ma, SearchType), pageSize, pageIndex);
        }

        /// <summary>
        /// 取得所有轉移信息
        /// </summary>
        /// <returns></returns>
        public static DataTable GetAllMoveAccountInfo()
        {
            return Utils.DrToDt(DatabaseProvider.GetInstance().GetAllMoveAccountInfo());
        }
        /// <summary>
        /// 取得所有轉移信息
        /// </summary>
        /// <returns></returns>
        public static DataTable GetAllMoveAccountInfo(string area)
        {
            return Utils.DrToDt(DatabaseProvider.GetInstance().GetAllMoveAccountInfo(area));
        }
        /// <summary>
        /// 取得所有轉移信息
        /// </summary>
        /// <param name="pageSize">分頁大小</param>
        /// <param name="pageIndex">當前頁</param>
        /// <returns></returns>
        public static DataTable GetAllMoveAccountInfo(int pageSize, int pageIndex)
        {
            return Utils.LoadDataRows(DatabaseProvider.GetInstance().GetAllMoveAccountInfo(), pageSize, pageIndex);
        }
        /// <summary>
        /// 取得所有轉移信息
        /// </summary>
        /// <param name="area">地區</param>
        /// <param name="pageSize">分頁大小</param>
        /// <param name="pageIndex">當前頁</param>
        /// <returns></returns>
        public static DataTable GetAllMoveAccountInfo(string area, int pageSize, int pageIndex)
        {
            return Utils.LoadDataRows(DatabaseProvider.GetInstance().GetAllMoveAccountInfo(area), pageSize, pageIndex);
        }
        /// <summary>
        /// 更新Message ProcessIp Status ProcessTime四個字段
        /// </summary>
        /// <param name="cs"></param>
        /// <returns></returns>
        public static int UpMoveAccountMessageProcessIpStatusProcessTime(MoveAccountInfo ma)
        {
            return DatabaseProvider.GetInstance().UpMoveAccountMessageProcessIpStatusProcessTime(ma);
        }
        /// <summary>
        /// 更新 ProcessIp Status ProcessTime三個字段
        /// </summary>
        /// <param name="cs"></param>
        /// <returns></returns>
        public static int UpMoveAccountStatusProcessTimeProcessIpById(MoveAccountInfo ma)
        {
            return DatabaseProvider.GetInstance().UpMoveAccountStatusProcessTimeProcessIpById(ma);
        }
        /// <summary>
        /// 根據ID查找記錄
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static DataTable GetMoveAccountById(string id)
        {
            return DatabaseProvider.GetInstance().GetMoveAccountById(id).Tables[0];
        }
        /// <summary>
        /// 根據ID刪除記錄
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static int DelMoveAccountById(string id)
        {
            return DatabaseProvider.GetInstance().DelMoveAccountById(id);
        }
    }
}
